
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>6.4 显示帖子 · Laravel学习-从零开发论坛系统</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="kaleozhou">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="5.html" />
    
    
    <link rel="prev" href="3.html" />
    

    
        <link rel="shortcut icon" href='../book.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../book.ico' type="image/x-icon">
    
    
        <link rel="apple-touch-icon" href='../book.ico'>
    
    
        
        <link rel="apple-touch-icon" sizes="120x120" href="../book.ico">
        
        <link rel="apple-touch-icon" sizes="180x180" href="../book.ico">
        
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.kaleozhou.top" target="_blank" class="custom-link">我的博客</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    序言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1/1.html">
            
                <a href="../chapter1/1.html">
            
                    
                    第一章 开发环境搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter2/readme.html">
            
                <a href="../chapter2/readme.html">
            
                    
                    第二章 创建应用及布局
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter2/1.html">
            
                <a href="../chapter2/1.html">
            
                    
                    2.1 创建应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter2/2.html">
            
                <a href="../chapter2/2.html">
            
                    
                    2.2 创建布局文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter2/3.html">
            
                <a href="../chapter2/3.html">
            
                    
                    2.3 创建首页展示
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter2/4.html">
            
                <a href="../chapter2/4.html">
            
                    
                    2.4 调整样式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../chapter3/readme.html">
            
                <a href="../chapter3/readme.html">
            
                    
                    第三章 laravel组件的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../chapter3/1.html">
            
                <a href="../chapter3/1.html">
            
                    
                    3.1 用户脚手架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../chapter3/2.html">
            
                <a href="../chapter3/2.html">
            
                    
                    3.2 注册验证码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../chapter3/3.html">
            
                <a href="../chapter3/3.html">
            
                    
                    3.3 邮箱验证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../chapter3/4.html">
            
                <a href="../chapter3/4.html">
            
                    
                    3.4 密码重置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter4/readme.html">
            
                <a href="../chapter4/readme.html">
            
                    
                    第四章 基础功能开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../chapter4/1.html">
            
                <a href="../chapter4/1.html">
            
                    
                    4.1 个人页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../chapter4/2.html">
            
                <a href="../chapter4/2.html">
            
                    
                    4.2 编辑个人资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../chapter4/3.html">
            
                <a href="../chapter4/3.html">
            
                    
                    4.3 显示个人资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../chapter4/4.html">
            
                <a href="../chapter4/4.html">
            
                    
                    4.4 上传头像
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter5/readme.html">
            
                <a href="../chapter5/readme.html">
            
                    
                    第五章 帖子功能开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter5/1.html">
            
                <a href="../chapter5/1.html">
            
                    
                    5.1 帖子分类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter5/2.html">
            
                <a href="../chapter5/2.html">
            
                    
                    5.2 代码生成器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../chapter5/3.html">
            
                <a href="../chapter5/3.html">
            
                    
                    5.3 生成话题骨架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../chapter5/4.html">
            
                <a href="../chapter5/4.html">
            
                    
                    5.4 假数据填充
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../chapter5/5.html">
            
                <a href="../chapter5/5.html">
            
                    
                    5.5 话题列表页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../chapter5/6.html">
            
                <a href="../chapter5/6.html">
            
                    
                    5.6 性能优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../chapter5/7.html">
            
                <a href="../chapter5/7.html">
            
                    
                    5.7 分类下的话题列表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../chapter5/8.html">
            
                <a href="../chapter5/8.html">
            
                    
                    5.8 话题排序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../chapter5/9.html">
            
                <a href="../chapter5/9.html">
            
                    
                    5.9 用户发布的话题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="readme.html">
            
                <a href="readme.html">
            
                    
                    第六章 话题开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="1.html">
            
                <a href="1.html">
            
                    
                    6.1 新建话题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="2.html">
            
                <a href="2.html">
            
                    
                    6.2 编辑器优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="3.html">
            
                <a href="3.html">
            
                    
                    6.3 上传图片
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.7.4" data-path="4.html">
            
                <a href="4.html">
            
                    
                    6.4 显示帖子
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="5.html">
            
                <a href="5.html">
            
                    
                    6.5 XSS安全漏洞
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="6.html">
            
                <a href="6.html">
            
                    
                    6.6 编辑帖子
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >6.4 显示帖子</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#64-&#x663E;&#x793A;&#x5E16;&#x5B50;"><b></b>6.4 &#x663E;&#x793A;&#x5E16;&#x5B50;</a></li><ul><li><span class="title-icon "></span><a href="#&#x5E16;&#x5B50;&#x8BE6;&#x60C5;&#x9875;"><b></b>&#x5E16;&#x5B50;&#x8BE6;&#x60C5;&#x9875;</a></li><li><span class="title-icon "></span><a href="#1&#x8DEF;&#x7531;&#x548C;&#x63A7;&#x5236;&#x5668;"><b></b>1.&#x8DEF;&#x7531;&#x548C;&#x63A7;&#x5236;&#x5668;</a></li><li><span class="title-icon "></span><a href="#2&#x4FEE;&#x6539;&#x6A21;&#x677F;"><b></b>2.&#x4FEE;&#x6539;&#x6A21;&#x677F;</a></li><li><span class="title-icon "></span><a href="#3&#x6D4B;&#x8BD5;&#x4E00;&#x4E0B;"><b></b>3.&#x6D4B;&#x8BD5;&#x4E00;&#x4E0B;</a></li><li><span class="title-icon "></span><a href="#4&#x6837;&#x5F0F;&#x8C03;&#x6574;"><b></b>4.&#x6837;&#x5F0F;&#x8C03;&#x6574;</a></li></ul></ul></div><a href="#64-&#x663E;&#x793A;&#x5E16;&#x5B50;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="64-&#x663E;&#x793A;&#x5E16;&#x5B50;"><a name="64-&#x663E;&#x793A;&#x5E16;&#x5B50;" class="anchor-navigation-ex-anchor" href="#64-&#x663E;&#x793A;&#x5E16;&#x5B50;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="64-&#x663E;&#x793A;&#x5E16;&#x5B50;" class="plugin-anchor" href="#64-&#x663E;&#x793A;&#x5E16;&#x5B50;"><i class="fa fa-link" aria-hidden="true"></i></a>6.4 &#x663E;&#x793A;&#x5E16;&#x5B50;</h1>
<h2 id="&#x5E16;&#x5B50;&#x8BE6;&#x60C5;&#x9875;"><a name="&#x5E16;&#x5B50;&#x8BE6;&#x60C5;&#x9875;" class="anchor-navigation-ex-anchor" href="#&#x5E16;&#x5B50;&#x8BE6;&#x60C5;&#x9875;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x5E16;&#x5B50;&#x8BE6;&#x60C5;&#x9875;" class="plugin-anchor" href="#&#x5E16;&#x5B50;&#x8BE6;&#x60C5;&#x9875;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5E16;&#x5B50;&#x8BE6;&#x60C5;&#x9875;</h2>
<p>&#x63A5;&#x4E0B;&#x6765;&#x6211;&#x4EEC;&#x628A;&#x53D1;&#x5E03;&#x7684;&#x5185;&#x5BB9;&#x663E;&#x793A;&#x51FA;&#x6765;</p>
<h2 id="1&#x8DEF;&#x7531;&#x548C;&#x63A7;&#x5236;&#x5668;"><a name="1&#x8DEF;&#x7531;&#x548C;&#x63A7;&#x5236;&#x5668;" class="anchor-navigation-ex-anchor" href="#1&#x8DEF;&#x7531;&#x548C;&#x63A7;&#x5236;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="1&#x8DEF;&#x7531;&#x548C;&#x63A7;&#x5236;&#x5668;" class="plugin-anchor" href="#1&#x8DEF;&#x7531;&#x548C;&#x63A7;&#x5236;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a>1.&#x8DEF;&#x7531;&#x548C;&#x63A7;&#x5236;&#x5668;</h2>
<p>&#x4EE3;&#x7801;&#x751F;&#x6210;&#x5668;&#x5DF2;&#x7ECF;&#x4E3A;&#x6211;&#x4EEC;&#x751F;&#x6210;&#x4E86;&#x8DEF;&#x7531;&#x63A7;&#x5236;&#x5668;&#x7684;&#x4EE3;&#x7801;&#xFF0C;&#x6211;&#x4EEC;&#x770B;show()&#x65B9;&#x6CD5;
app/Http/Controllers/TopicsController.php</p>
<pre><code>.
.
.
class TopicsController extends Controller
{
    .
    .
    .
    public function show(Topic $topic)
    {
        return view(&apos;topics.show&apos;, compact(&apos;topic&apos;));
    }
    .
    .
    .
}
</code></pre><p>&#x6B64;&#x5904;&#x4F7F;&#x7528;laravel&#x7684;&#x3010;&#x9690;&#x6027;&#x8DEF;&#x7531;&#x6A21;&#x578B;&#x7ED1;&#x5B9A;&#x3011;&#x529F;&#x80FD;&#xFF0C;&#x5F53;&#x8BF7;&#x6C42;<a href="http://kaleobbs.test/topics/1&#x65F6;,$topic&#x53D8;&#x91CF;&#x4F1A;&#x81EA;&#x52A8;&#x89E3;&#x6790;&#x4E3A;ID&#x4E3A;1&#x7684;&#x5E16;&#x5B50;&#x5BF9;&#x8C61;&#x3002;" target="_blank">http://kaleobbs.test/topics/1&#x65F6;,$topic&#x53D8;&#x91CF;&#x4F1A;&#x81EA;&#x52A8;&#x89E3;&#x6790;&#x4E3A;ID&#x4E3A;1&#x7684;&#x5E16;&#x5B50;&#x5BF9;&#x8C61;&#x3002;</a></p>
<h2 id="2&#x4FEE;&#x6539;&#x6A21;&#x677F;"><a name="2&#x4FEE;&#x6539;&#x6A21;&#x677F;" class="anchor-navigation-ex-anchor" href="#2&#x4FEE;&#x6539;&#x6A21;&#x677F;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="2&#x4FEE;&#x6539;&#x6A21;&#x677F;" class="plugin-anchor" href="#2&#x4FEE;&#x6539;&#x6A21;&#x677F;"><i class="fa fa-link" aria-hidden="true"></i></a>2.&#x4FEE;&#x6539;&#x6A21;&#x677F;</h2>
<p>&#x63A5;&#x4E0B;&#x6765;&#x4FEE;&#x6539;&#x6A21;&#x677F;:
resources/views/topics/show.blade.php</p>
<pre><code>@extends(&apos;layouts.app&apos;)

@section(&apos;title&apos;, $topic-&gt;title)
@section(&apos;description&apos;, $topic-&gt;excerpt)

@section(&apos;content&apos;)

  &lt;div class=&quot;row&quot;&gt;

    &lt;div class=&quot;col-lg-3 col-md-3 hidden-sm hidden-xs author-info&quot;&gt;
      &lt;div class=&quot;card &quot;&gt;
        &lt;div class=&quot;card-body&quot;&gt;
          &lt;div class=&quot;text-center&quot;&gt;
            &#x4F5C;&#x8005;&#xFF1A;{{ $topic-&gt;user-&gt;name }}
          &lt;/div&gt;
          &lt;hr&gt;
          &lt;div class=&quot;media&quot;&gt;
            &lt;div align=&quot;center&quot;&gt;
              &lt;a href=&quot;{{ route(&apos;users.show&apos;, $topic-&gt;user-&gt;id) }}&quot;&gt;
                &lt;img class=&quot;thumbnail img-fluid&quot; src=&quot;{{ $topic-&gt;user-&gt;avatar }}&quot; width=&quot;300px&quot; height=&quot;300px&quot;&gt;
              &lt;/a&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class=&quot;col-lg-9 col-md-9 col-sm-12 col-xs-12 topic-content&quot;&gt;
      &lt;div class=&quot;card &quot;&gt;
        &lt;div class=&quot;card-body&quot;&gt;
          &lt;h1 class=&quot;text-center mt-3 mb-3&quot;&gt;
            {{ $topic-&gt;title }}
          &lt;/h1&gt;

          &lt;div class=&quot;article-meta text-center text-secondary&quot;&gt;
            {{ $topic-&gt;created_at-&gt;diffForHumans() }}
            &#x22C5;
            &lt;i class=&quot;far fa-comment&quot;&gt;&lt;/i&gt;
            {{ $topic-&gt;reply_count }}
          &lt;/div&gt;

          &lt;div class=&quot;topic-body mt-4 mb-4&quot;&gt;
            {!! $topic-&gt;body !!}
          &lt;/div&gt;

          &lt;div class=&quot;operate&quot;&gt;
            &lt;hr&gt;
            &lt;a href=&quot;{{ route(&apos;topics.edit&apos;, $topic-&gt;id) }}&quot; class=&quot;btn btn-outline-secondary btn-sm&quot; role=&quot;button&quot;&gt;
              &lt;i class=&quot;far fa-edit&quot;&gt;&lt;/i&gt; &#x7F16;&#x8F91;
            &lt;/a&gt;
            &lt;a href=&quot;#&quot; class=&quot;btn btn-outline-secondary btn-sm&quot; role=&quot;button&quot;&gt;
              &lt;i class=&quot;far fa-trash-alt&quot;&gt;&lt;/i&gt; &#x5220;&#x9664;
            &lt;/a&gt;
          &lt;/div&gt;

        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
@stop
</code></pre><p>&#x8BDD;&#x9898;&#x5B57;&#x6BB5; excerpt &#x662F;&#x6587;&#x7AE0;&#x6458;&#x5F55;&#xFF0C;&#x7528;&#x4F5C; SEO &#x9875;&#x9762;&#x63CF;&#x8FF0;&#x4F7F;&#x7528;&#xFF0C;&#x56E0;&#x6B64;&#x6211;&#x4EEC;&#x8FD8;&#x9700;&#x8981;&#x4FEE;&#x6539;&#x4E3B;&#x5E03;&#x5C40;&#x6A21;&#x677F;&#xFF0C;&#x65B0;&#x589E; description &#x539F;&#x6807;&#x7B7E;&#xFF1A;
resources/views/layouts/app.blade.php</p>
<pre><code>  &lt;title&gt;@yield(&apos;title&apos;, &apos;KaleoBBS&apos;) - Laravel &#x8001;&#x5468;&#x8BBA;&#x575B;&lt;/title&gt;
  &lt;meta name=&quot;description&quot; content=&quot;@yield(&apos;description&apos;, &apos;&#x95F2;&#x8C08;&#x793E;&#x533A;&apos;)&quot; /&gt;
</code></pre><h2 id="3&#x6D4B;&#x8BD5;&#x4E00;&#x4E0B;"><a name="3&#x6D4B;&#x8BD5;&#x4E00;&#x4E0B;" class="anchor-navigation-ex-anchor" href="#3&#x6D4B;&#x8BD5;&#x4E00;&#x4E0B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="3&#x6D4B;&#x8BD5;&#x4E00;&#x4E0B;" class="plugin-anchor" href="#3&#x6D4B;&#x8BD5;&#x4E00;&#x4E0B;"><i class="fa fa-link" aria-hidden="true"></i></a>3.&#x6D4B;&#x8BD5;&#x4E00;&#x4E0B;</h2>
<p>&#x4FEE;&#x590D;&#x7F16;&#x8F91;&#x5668;&#x56FE;&#x7247;&#x8D85;&#x51FA;&#x7F16;&#x8F91;&#x5668;&#x95EE;&#x9898;
&#x5FEB;&#x901F;&#x4FEE;&#x590D;&#x4E0B;&#xFF1A;</p>
<p>resources/sass/app.scss</p>
<pre><code>.simditor-body img {
  max-width:100%;
}
</code></pre><p>&#x6548;&#x679C;&#xFF1A;
<img src="http://images.kaleozhou.top/6.4-01.png" alt="6.4-01.png"></p>
<h2 id="4&#x6837;&#x5F0F;&#x8C03;&#x6574;"><a name="4&#x6837;&#x5F0F;&#x8C03;&#x6574;" class="anchor-navigation-ex-anchor" href="#4&#x6837;&#x5F0F;&#x8C03;&#x6574;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="4&#x6837;&#x5F0F;&#x8C03;&#x6574;" class="plugin-anchor" href="#4&#x6837;&#x5F0F;&#x8C03;&#x6574;"><i class="fa fa-link" aria-hidden="true"></i></a>4.&#x6837;&#x5F0F;&#x8C03;&#x6574;</h2>
<p>resources/sass/_topic_body.scss</p>
<pre><code>.simditor-body, .topic-body {
  font-size: 15px;
  line-height: 1.3;
  overflow: hidden;
  line-height: 1.6;
  word-wrap: break-word;

  a {
    background: transparent;
  }

  a:active,
  a:hover {
    outline: 0;
  }

  ol li {
    margin: 8px 0;
  }

  pre[class*=language-] {
    margin: 1.2em 0 !important;
  }

  strong {
    font-weight: bold;
  }

  h1 {
    font-size: 2em;
    margin: 0.67em 0;
  }

  img {
    border: 0;
  }

  hr {
    -moz-box-sizing: content-box;
    box-sizing: content-box;
    height: 0;
  }

  table {
    border-collapse: collapse;
    border-spacing: 0;
  }

  td,
  th {
    padding: 0;
  }

  * {
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  }

  a {
    text-decoration: none;
  }

  a:hover,
  a:focus,
  a:active {
    text-decoration: none;
  }

  hr {
    height: 0;
    margin: 15px 0;
    overflow: hidden;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #ddd;
  }

  hr:before,
  hr:after {
    display: table;
    content: &quot; &quot;;
  }

  hr:after {
    clear: both;
  }

  blockquote {
    margin: 0;
  }

  ul,
  ol {
    padding: 0;
    margin-top: 0;
    margin-bottom: 0;
  }

  ol ol {
    list-style-type: lower-roman;
  }

  dd {
    margin-left: 0;
  }

  code,
  pre {
    font-family: monaco, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;
    font-size: 1em;
  }

  pre {
    margin-top: 0;
    margin-bottom: 0;
    overflow: auto;
  }

  .topic-body&gt;*:first-child {
    margin-top: 0 !important;
  }

  .topic-body&gt;*:last-child {
    margin-bottom: 0 !important;
  }

  .anchor {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    display: block;
    padding-right: 6px;
    padding-left: 30px;
    margin-left: -30px;
  }

  .anchor:focus {
    outline: none;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    position: relative;
    margin-top: 1.0em;
    margin-bottom: 16px;
    line-height: 1.4;
  }

  h1 {
    padding-bottom: 0.3em;
    font-size: 2.25em;
    line-height: 1.2;
    border-bottom: 1px solid #eee;
  }

  h2 {
    padding-bottom: 0.3em;
    font-size: 1.3em;
    line-height: 1.225;
    border-bottom: 1px solid #eee;
  }

  h3 {
    font-size: 1.2em;
    line-height: 1.43;
  }

  h4 {
    font-size: 1.1em;
  }

  h5 {
    font-size: 1.0em;
  }

  h6 {
    font-size: 0.9em;
    color: #777;
  }

  p,
  blockquote,
  ul,
  ol,
  dl,
  table,
  pre {
    margin-top: 0;
    margin-bottom: 0px;
    line-height: 30px;
  }

  hr {
    border: 2px dashed #F0F4F6;
    border-bottom: 0px;
    margin: 18px auto;
    width: 50%;
  }

  ul,
  ol {
    padding-left: 2em;
    padding: 10px 20px 10px 30px;
    color: #7d8688;
  }

  ol ol,
  ol ul {
    margin-top: 0;
    margin-bottom: 0;
  }

  li&gt;p {
    margin-top: 6px;
  }

  dl {
    padding: 0;
  }

  dl dt {
    padding: 0;
    margin-top: 6px;
    font-size: 1em;
    font-style: italic;
    font-weight: bold;
  }

  dl dd {
    padding: 0 16px;
    margin-bottom: 16px;
  }

  blockquote {
    font-size: inherit;
    padding: 0 15px;
    color: #777;
    border-left: 4px solid #ddd;
  }

  blockquote&gt;:first-child {
    margin-top: 20px;
  }

  blockquote&gt;:last-child {
    margin-bottom: 20px;
  }

  blockquote {
    margin: 20px 0 !important;
    background-color: #f5f8fc;
    padding: 1rem;
    color: #8796A8;
    border-left: none;
  }

  table {
    display: block;
    width: 100%;
    overflow: auto;
    margin: 25px 0;
  }

  table th {
    font-weight: bold;
  }

  table th,
  table td {
    padding: 6px 13px;
    border: 1px solid #ddd;
  }

  table tr {
    background-color: #fff;
    border-top: 1px solid #ccc;
  }

  table tr:nth-child(2n) {
    background-color: #f8f8f8;
  }

  img {
    max-width: 100%;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  }

  img {
    border: 1px solid #ddd;
    box-shadow: 0 0 30px #ccc;
    -moz-box-shadow: 0 0 30px #ccc;
    -webkit-box-shadow: 0 0 30px #ccc;
    margin-bottom: 30px;
    margin-top: 10px;
  }

  code {
    background: rgba(90, 87, 87, 0);
    margin: 5px;
    color: #858080;
    border-radius: 4px;
    background-color: #f9fafa;
    border: 1px solid #e4e4e4;
    max-width: 740px;
    overflow-x: auto;
    font-size: .9em;
    padding: 1px 2px 1px;
  }

  code:before,
  code:after {
    letter-spacing: -0.2em;
    content: &quot;\00a0&quot;;
  }

  pre&gt;code {
    padding: 0;
    margin: 0;
    font-size: 100%;
    white-space: pre;
    background: transparent;
    border: 0;
  }

  .highlight {
    margin-bottom: 16px;
  }

  .highlight pre,
  pre {
    padding: 14px;
    overflow: auto;
    line-height: 1.45;
    // background-color: #4e4e4e;
    border-radius: 3px;
    color: inherit;
    border: none;
  }

  .highlight pre {
    margin-bottom: 0;
  }

  pre {
    word-wrap: normal;
  }

  pre code {
    display: block;
    padding: 0;
    margin: 0;
    overflow: initial;
    line-height: inherit;
    word-wrap: normal;
    background-color: transparent;
    border: 0;
  }

  pre code:before,
  pre code:after {
    content: normal;
  }
}
</code></pre><p>&#x5728;&#x4E3B;&#x6837;&#x5F0F;&#x4EE3;&#x7801;&#x4E2D;&#x5BF9;&#x5176;&#x8FDB;&#x884C;&#x52A0;&#x8F7D;&#xFF0C;&#x5E76;&#x4E66;&#x5199;&#x9875;&#x9762;&#x7ED3;&#x6784;&#x7684;&#x6837;&#x5F0F;&#xFF1A;</p>
<p>resources/sass/app.scss</p>
<pre><code>.
.
.

/* Topic Show Page */

@import &quot;topic_body&quot;;

.topics-show-page {

    .card {
        padding: 15px;

        h1 {
            margin: 0.4em auto 0.6em;
            font-size: 28px;
            line-height: 38px;
        }
    }
}
</code></pre><p>&#x7F16;&#x8BD1;&#x5B8C;&#x6210;&#x89C2;&#x5BDF;&#x6548;&#x679C;&#xFF1A;
<img src="http://images.kaleozhou.top/6.4-02.png" alt="6.4-02.png"></p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; kaleozhou 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-05-22 09:59:31
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="3.html" class="navigation navigation-prev " aria-label="Previous page: 6.3 上传图片">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="5.html" class="navigation navigation-next " aria-label="Next page: 6.5 XSS安全漏洞">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"6.4 显示帖子","level":"1.7.4","depth":2,"next":{"title":"6.5 XSS安全漏洞","level":"1.7.5","depth":2,"path":"chapter6/5.md","ref":"chapter6/5.md","articles":[]},"previous":{"title":"6.3 上传图片","level":"1.7.3","depth":2,"path":"chapter6/3.md","ref":"chapter6/3.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-sharing","splitter","expandable-chapters-small","anchors","donate","sharing-plus","anchor-navigation-ex","tbfed-pagefooter","favicon"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy kaleozhou 2019","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"github":{"url":"https://gitee.com/kaleozhou"},"splitter":{},"search":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"donate":{"alipay":"http://images.kaleozhou.top/zanshang.png","alipayText":" ","button":"赞赏","title":"","wechat":"","wechatText":"微信打赏"},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":false},"favicon":{"shortcut":"./book.ico","bookmark":"./book.ico","appleTouch":"./book.ico","appleTouchMore":{"120x120":"./book.ico","180x180":"./book.ico"}},"github-buttons":{"buttons":[{"user":"kaleozhou","repo":"guanwang","type":"star","size":"small","count":true}]},"expandable-chapters-small":{},"sharing":{"qq":true,"all":["weibo","qq","qzone"],"douban":true,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":true,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{}},"theme":"default","author":"kaleozhou","pdf":{"pageBreaksBefore":"/","paperSize":"a4","margin":{"right":30,"left":30,"top":30,"bottom":50},"fontSize":18,"pageSize":"a4","fontFamily":"Arial","doc":true,"chapterMark":"pagebreak","pageNumbers":true},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Laravel学习-从零开发论坛系统","language":"zh-hans","links":{"sidebar":{"我的博客":"http://www.kaleozhou.top"}},"gitbook":"3.2.3","description":"laravel框架开发论坛系统"},"file":{"path":"chapter6/4.md","mtime":"2019-05-22T01:59:31.211Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-25T02:56:39.861Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

